package com.adams.dcxt.core;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ReglexUtils {
    public static boolean regex(String regexRule, String value) {
        Pattern pattern = Pattern.compile(regexRule);
        Matcher matcher = pattern.matcher(value);
        return matcher.find();
    }

    /**
     * value值是否超出长度(len),value.len<len返回true 
     *  没有超出：ture
     * @param value
     * @param len
     * @return
     */
    public static boolean strLenCompare(String value, int len) {
        if (value == null) {
            return false;
        } else {
            if (value.length() >= len) {
                return false;
            } else {
                return true;
            }
         }
    }
    
    public static void main(String[] args) {
        System.out.println(strLenCompare("风撒谎",100));
    }
    
}
